<!DOCTYPE html>
<html class="pixel-ratio-1 watch-active-state">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="theme-color" content="">
    <title>登录</title>
    <link rel="stylesheet" href="/resources/wap/css/framework7_002.css">
    <link rel="stylesheet" href="/resources/wap/css/style.css">

    <script src="/resources/common/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="/resources/common/js/md5.js"></script>
    <script type="text/javascript" src="/resources/js/self.js"></script>
</head>

<body>
<div class="turnon"></div>
<div class="navbar">
    <div class="navbar-inner">
        <div class="center"><a href="javascript:void(0)">进货商登录</a></div>
    </div>
</div>

<div class="dlbox"><input name="account" class="dlyhm" type="text"  placeholder="账号" foundfield="" compareway="2"></div>
<div class="dlbox"><input name="password" class="dlyhm" type="password"  placeholder="密码" foundfield="" compareway="2"></div>
<!--<div class="wjmm"><a href="" style="float:right;">忘记密码？</a></div>-->
<div class="dlbut submit"><a href="javascript:void(0)">登录</a></div>
<div class="zcbut register"><a href="register.html">注册</a></div>
</body>
<script type="text/javascript">
    $(function () {
        $(".submit").click(function () {
            var account = $("input[name='account']").val();
            var password = $("input[name='password']").val();
            if(account.replace(/\s/g, '') == ''){
                alert("请输入登陆账号");
                return;
            }
            if(password.replace(/\s/g, '') == ''){
                alert("请输入密码");
                return;
            }
            var params = {};
            params['account'] = account;
            params['password'] = hex_md5(password);
            $.ajax({
                url:'/wap/customer/loginOn.do',
                type:'post',
                data: params,
                success:function(data){
                    if(data.success){
                        var customer  = data.data;
                        if(customer.auditStatus !='pass'){
                            window.location.href = "/html/wap/customer/certify.html?r="+new Date().getTime();
                        }else{
                            window.location.href = "/html/wap/customer/product_list.html?r="+new Date().getTime();
                        }

                    }else{
                        alert(data.msg);
                    }
                },
                error:function () {
                    alert("系统错误！");
                }
            });
        });
        $(".register").click(function () {
            window.location.href="register.html";
        });

    })
</script>
</html>
